package com.sh.data.engine.application.model.request.api;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author : fuchen
 * @date : 2022/1/21 14:06
 */

@Data
@Schema
public class DataApiGroupRequest {

    @Schema(description = "主键id")
    private Long id;

    @Schema(description = "上级id")
    private Long parentId;

    @NotBlank(message = "分组名不能为空")
    @Length(min = 2, max = 64, message = "2-64个字符,支持中文、英文字母、数字和下划线")
    @Pattern(regexp = "[a-zA-Z0-9_\\u4e00-\\u9fa5]+", message = "分组名仅支持中文、字母、数字、下划线")
    @Schema(description = "分组名", required = true)
    private String groupName;

    @Schema(description = "描述")
    @Length(max = 128, message = "描述最多128个字符")
    private String desc;
}
